<template>
  <div class="app-container">
    <el-row class="toolbar">
      <el-col :span="24">
        <el-form :inline="true">
          <el-select v-model="type" placeholder="缓存类型">
            <el-option
              v-for="item in options"
              :key="item.value"
              :label="item.label"
              :value="item.value">
            </el-option>
          </el-select>

        <el-form-item>
          <el-button type="primary" v-on:click="clean">清理</el-button>
        </el-form-item>
      </el-form>
      </el-col>

    </el-row>


  </div>
</template>

<script>
import { cleanCache } from '@/api/api'

export default {
  data() {
    return {
        type:'permiss',
        options: [{
           value: 'token',
           label: '用户Token'
         },
          {
           value: 'permiss',
           label: '角色权限'
         }],

    }

  },

  methods: {
    clean() {
      cleanCache(this.type).then(data => {
        this.$message({
         message: '清理成功',
         type: 'success'
       });
      })
    },

  }
}
</script>
